package com.woniu.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.woniu.entity.TestType;
import com.woniu.model.Result;
import com.woniu.service.TestTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author D
 * @since 2023-03-27 08:24:57
 */
@RestController
@RequestMapping("/testType")
public class TestTypeController {
    @Autowired
    TestTypeService testTypeService;
    @RequestMapping("/getByParentType")
    public Result<List<TestType>>getByParentType(Integer parentType){
        QueryWrapper<TestType>wrapper=new QueryWrapper<>();
        wrapper.eq("parent_type" ,parentType);
        return Result.successResult(testTypeService.list(wrapper));
    }
}

